
include std/unittest.e
include qt/core.e as qt
include std/types.e
include qt/qtUtils.e  as qu

atom xyz = 0
function timeTimer(atom t)
  --not testing the actual passage of time
     test_equal("in timer 0", 0, xyz )
    xyz = 1
      stopTimer(t1)
	return 1
end function

qt:init()   --a Qt instance must be avilable to use Qt timers

atom t1= Timer(,1000) --us
    startTimer(t1)
    qt:connect(t1, "timeout()", "slot()", routine_id("timeTimer"))
    setIntervalTimer(t1, 10)

test_equal("timer ran", 1, xyz )
for x = 1 to 28100 do xyz += 0.003 end for

--should add some multitasking to see if timers conflict
test_equal("timer ran", 1, xyz )

test_report()
